<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="./layui/css/layui.css">
		<style type="text/css">
			.box{
				display:flex;
				flex-direction: row;
				justify-content: center;
				align-items: center;
				width: 100vm;
				height: 100vh;
			}
			.box .layui-form{
				width: 50%;
				height: 60%;
				border: 1px solid #C9C9C9;
				box-shadow: 2px 2px #fff;
				border-radius: 5px;
				padding: 30px 10px;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<form class="layui-form" action="fileManage.html">
				<div class="layui-form-item">
				  <label class="layui-form-label">账号</label>
				  <div class="layui-input-block">
				    <input type="text" name="userAccount" required  lay-verify="required" placeholder="请输入账号/手机号码/邮箱" autocomplete="off" class="layui-input">
				  </div>
				</div>
				<div class="layui-form-item">
				  <label class="layui-form-label">密码</label>
				  <div class="layui-input-block">
				    <input type="password" name="password" required  lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
				  </div>
				</div>
				<div class="layui-form-item">
				  <div class="layui-input-block">
				    <button class="login layui-btn" type="button">登录</button>
				  </div>
				</div>
			</form>
		<script src="https://lib.baomitu.com/jquery/3.0.0/jquery.js"></script>
		<script src="./layui/layui.js"></script>
		<script type="text/javascript">
			let getData=(userAccount,password)=>{
				$.ajax({
					type:'POST',
					url:'http://122.225.55.70:2666/login/login',
					contentType:'application;charset=UTF-8',					data:JSON.stringify(userAccount,password),					dataJson: 'json',
					success(res){
						if(res.code!=='0'){
								location.href='fileManage.html'
						}else{
							alert("错误")
						}
					}
				})
			}
			$(".login").click(()=>{
				const userAccount=$(".userAccount").val()
				const password=$(".password").val()
				getData(userAccount,password)
			})
			
		</script>
		</div>
	</body>
</html>
